package com.shanxia.codec.enums;

import java.util.Objects;

public enum ChargingPermissionEnum {

    PROHIBITION(0x00, "禁止"),
    PERMISSON(0x01, "允许"),
    UNKNOWN(99, "未知");

    public static ChargingPermissionEnum getByCode(int code) {
        for (ChargingPermissionEnum enums : ChargingPermissionEnum.values()) {
            if (Objects.equals(enums.code, code)) {
                return enums;
            }
        }
        return ChargingPermissionEnum.UNKNOWN;
    }

    ChargingPermissionEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int code;
    public String name;
}